<?php

namespace addons\kzvote\controller;

use app\common\model\kzvote\Faq as FaqModel;

class Faq extends Base
{
    protected $noNeedLogin = ['index','detail'];

    public function index()
    {
        $FaqModel = new FaqModel;
        $list = $FaqModel->field('id,name')->order('weigh desc')->paginate(20,true);
        $this->success('',$list);
    }

    public function detail()
    {
        $id = $this->request->param('id');
        $info = FaqModel::get($id);
        if (!$info){
            $this->error('数据不存在');
        }
        $this->success('',$info);
    }

}
